<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    request.setAttribute("contextPath", request.getContextPath());
%>
<html>
<head>
<title>List All Books</title>
</head>
<body>
	<a href="${contextPath }/admin/home">返回后台</a>
	
	<a href="${contextPath }/admin/addBookView">新增书籍</a>
	<br/><br/>
	  <!-- bookid               int(10) not null,
		   categoryid           int(10),
		   bookname             varchar(200) not null,
		   author               varchar(50) not null,
		   price                decimal(8,2),
		   press                varchar(100),
		   publishtime          char(10),
		   edition              int(11),
		   pageNum              int(11),
		   image_w              varchar(100),
		   image_b              varchar(100),
		   reserve              int(10) not null,
		   score            -->
	<table width="80%" border="1">
		<tr>
			<td>bookId</td>
			<td>categoryId</td>
			<td>bookName</td>
			<td>author</td>
			<td>price</td>
			<td>press</td>
			<td>publishTime</td>
			<td>edition</td>
			<td>pageNum</td>
			<td width="10%">操作</td>
		</tr>
		<c:forEach items="${books }" var="b">
			<tr>
				<td>${b.bookId }</td>
				<td>${b.categoryId }</td>
				<td>${b.bookName }</td>
				<td>${b.author }</td>
				<td>${b.price }</td>
				<td>${b.press }</td>
				<td>${b.publishTime }</td>
				<td>${b.edition }</td>
				<td>${b.pageNum }</td>
				<td>
				    <a href="${contextPath }/admin/updateBook/${b.bookId }">编辑</a>
				    &nbsp;&nbsp;
				    <a href="${contextPath }/admin/deleteBook/${b.bookId }">删除</a>
				</td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>
